****
** Replication File:
**
** “Are Republicans and Conservatives More Likely 
** to Believe Conspiracy Theories?”
**
** Adam Enders, Christina Farhart, Joanne Miller,
** Joseph Uscinski, Kyle Saunders, and Hugo Drochon
**
** Analyses conducted in Stata/SE 15.1
****

set more off

* Set working directory

* Open Stata dataset
use "2020 Cross-National Data.dta"

********************************************************************************

* Missing: China, Thailand, India, Indonesia, USA
replace country = . if country == 230
replace country = . if country == 216
replace country = . if country == 101
replace country = . if country == 102
replace country = . if country == 46


* Recode ideology and conspiracy variables
gen ideo = politics_scale_profile_update 
recode ideo (8=.) (100=.)

gen truther = Glob_conspire_1
recode truther (5=.) (4=1) (3=2) (2=3) (1=4)

gen antivaxx = Glob_conspire_3
recode antivaxx (5=.) (4=1) (3=2) (2=3) (1=4)

gen singlegroup = Glob_conspire_4
recode singlegroup (5=.) (4=1) (3=2) (2=3) (1=4)

gen globalwarming = Glob_conspire_5
recode globalwarming (5=.) (4=1) (3=2) (2=3) (1=4)

gen aliens = Glob_conspire_6
recode aliens (5=.) (4=1) (3=2) (2=3) (1=4)

gen aids = Glob_conspire_7
recode aids (5=.) (4=1) (3=2) (2=3) (1=4)

gen holocaust = Glob_conspire_8
recode holocaust (5=.) (4=1) (3=2) (2=3) (1=4)

gen moon = Glob_conspire_10
recode moon (5=.) (4=1) (3=2) (2=3) (1=4)

gen covidmyth = GlobCOVID_truefalse_3
recode covidmyth (5=.) (4=1) (3=2) (2=3) (1=4)

gen exaggerated = GlobCOVID_truefalse_4
recode exaggerated (5=.) (4=1) (3=2) (2=3) (1=4)

gen pharma = GlobCOVID_truefalse_7
recode pharma (5=.) (4=1) (3=2) (2=3) (1=4)

********************************************************************************

****
** Correlations for Figure 2, stored in
** "Cross-national Correlations.csv"
****

* Truther
levelsof country, local(lev)	
	
foreach i of local lev {
sem (<- ideo truther if country == `i'), standardize
matrix mat`i' = r(table)
scalar corr`i' = mat`i'[1, 5]
scalar lower`i' = mat`i'[5, 5]
scalar upper`i' = mat`i'[6, 5]
matrix comb`i' = corr`i' , lower`i' , upper`i'
matrix rownames comb`i' = "Truther"
}

matrix colnames comb1 = corr lower upper
matrix truther = comb1 \ comb15 \ comb32 \ comb40 \ comb60 \ comb65 ///
\ comb75 \ comb82 \ comb85 \ comb99 \ comb108 \ comb110 \ comb140 ///
\ comb159 \ comb175 \ comb191 \ comb201 \ comb204 \ comb210 \ comb223


* Anti-vaxx
levelsof country, local(lev)	
	
foreach i of local lev {
sem (<- ideo antivaxx if country == `i'), standardize
matrix mat`i' = r(table)
scalar corr`i' = mat`i'[1, 5]
scalar lower`i' = mat`i'[5, 5]
scalar upper`i' = mat`i'[6, 5]
matrix comb`i' = corr`i' , lower`i' , upper`i'
matrix rownames comb`i' = "Anti-vaxx"
}

matrix antivaxx = comb1 \ comb15 \ comb32 \ comb40 \ comb60 \ comb65 ///
\ comb75 \ comb82 \ comb85 \ comb99 \ comb108 \ comb110 \ comb140 ///
\ comb159 \ comb175 \ comb191 \ comb201 \ comb204 \ comb210 \ comb223


* Single group
levelsof country, local(lev)	
	
foreach i of local lev {
sem (<- ideo singlegroup if country == `i'), standardize
matrix mat`i' = r(table)
scalar corr`i' = mat`i'[1, 5]
scalar lower`i' = mat`i'[5, 5]
scalar upper`i' = mat`i'[6, 5]
matrix comb`i' = corr`i' , lower`i' , upper`i'
matrix rownames comb`i' = "Single"
}

matrix singlegroup = comb1 \ comb15 \ comb32 \ comb40 \ comb60 \ comb65 ///
\ comb75 \ comb82 \ comb85 \ comb99 \ comb108 \ comb110 \ comb140 ///
\ comb159 \ comb175 \ comb191 \ comb201 \ comb204 \ comb210 \ comb223


* Global warming
levelsof country, local(lev)	
	
foreach i of local lev {
sem (<- ideo globalwarming if country == `i'), standardize
matrix mat`i' = r(table)
scalar corr`i' = mat`i'[1, 5]
scalar lower`i' = mat`i'[5, 5]
scalar upper`i' = mat`i'[6, 5]
matrix comb`i' = corr`i' , lower`i' , upper`i'
matrix rownames comb`i' = "Global"
}

matrix globalwarming = comb1 \ comb15 \ comb32 \ comb40 \ comb60 \ comb65 ///
\ comb75 \ comb82 \ comb85 \ comb99 \ comb108 \ comb110 \ comb140 ///
\ comb159 \ comb175 \ comb191 \ comb201 \ comb204 \ comb210 \ comb223


* Aliens
levelsof country, local(lev)	
	
foreach i of local lev {
sem (<- ideo aliens if country == `i'), standardize
matrix mat`i' = r(table)
scalar corr`i' = mat`i'[1, 5]
scalar lower`i' = mat`i'[5, 5]
scalar upper`i' = mat`i'[6, 5]
matrix comb`i' = corr`i' , lower`i' , upper`i'
matrix rownames comb`i' = "UFOs"
}

matrix aliens = comb1 \ comb15 \ comb32 \ comb40 \ comb60 \ comb65 ///
\ comb75 \ comb82 \ comb85 \ comb99 \ comb108 \ comb110 \ comb140 ///
\ comb159 \ comb175 \ comb191 \ comb201 \ comb204 \ comb210 \ comb223


* AIDS
levelsof country, local(lev)	
	
foreach i of local lev {
sem (<- ideo aids if country == `i'), standardize
matrix mat`i' = r(table)
scalar corr`i' = mat`i'[1, 5]
scalar lower`i' = mat`i'[5, 5]
scalar upper`i' = mat`i'[6, 5]
matrix comb`i' = corr`i' , lower`i' , upper`i'
matrix rownames comb`i' = "AIDS"
}

matrix aids = comb1 \ comb15 \ comb32 \ comb40 \ comb60 \ comb65 ///
\ comb75 \ comb82 \ comb85 \ comb99 \ comb108 \ comb110 \ comb140 ///
\ comb159 \ comb175 \ comb191 \ comb201 \ comb204 \ comb210 \ comb223


* Moon landing
levelsof country, local(lev)	
	
foreach i of local lev {
sem (<- ideo moon if country == `i'), standardize
matrix mat`i' = r(table)
scalar corr`i' = mat`i'[1, 5]
scalar lower`i' = mat`i'[5, 5]
scalar upper`i' = mat`i'[6, 5]
matrix comb`i' = corr`i' , lower`i' , upper`i'
matrix rownames comb`i' = "Moon"
}

matrix moon = comb1 \ comb15 \ comb32 \ comb40 \ comb60 \ comb65 ///
\ comb75 \ comb82 \ comb85 \ comb99 \ comb108 \ comb110 \ comb140 ///
\ comb159 \ comb175 \ comb191 \ comb201 \ comb204 \ comb210 \ comb223


* COVID myth
levelsof country, local(lev)	
	
foreach i of local lev {
sem (<- ideo covidmyth if country == `i'), standardize
matrix mat`i' = r(table)
scalar corr`i' = mat`i'[1, 5]
scalar lower`i' = mat`i'[5, 5]
scalar upper`i' = mat`i'[6, 5]
matrix comb`i' = corr`i' , lower`i' , upper`i'
matrix rownames comb`i' = "Myth"
}

matrix covidmyth = comb1 \ comb15 \ comb32 \ comb40 \ comb60 \ comb65 ///
\ comb75 \ comb82 \ comb85 \ comb99 \ comb108 \ comb110 \ comb140 ///
\ comb159 \ comb175 \ comb191 \ comb201 \ comb204 \ comb210 \ comb223


* COVID exaggerated
levelsof country, local(lev)	
	
foreach i of local lev {
sem (<- ideo exaggerated if country == `i'), standardize
matrix mat`i' = r(table)
scalar corr`i' = mat`i'[1, 5]
scalar lower`i' = mat`i'[5, 5]
scalar upper`i' = mat`i'[6, 5]
matrix comb`i' = corr`i' , lower`i' , upper`i'
matrix rownames comb`i' = "Deaths"
}

matrix exaggerated = comb1 \ comb15 \ comb32 \ comb40 \ comb60 \ comb65 ///
\ comb75 \ comb82 \ comb85 \ comb99 \ comb108 \ comb110 \ comb140 ///
\ comb159 \ comb175 \ comb191 \ comb201 \ comb204 \ comb210 \ comb223


* Pharma
levelsof country, local(lev)	
	
foreach i of local lev {
sem (<- ideo pharma if country == `i'), standardize
matrix mat`i' = r(table)
scalar corr`i' = mat`i'[1, 5]
scalar lower`i' = mat`i'[5, 5]
scalar upper`i' = mat`i'[6, 5]
matrix comb`i' = corr`i' , lower`i' , upper`i'
matrix rownames comb`i' = "Pharma"
}

matrix pharma = comb1 \ comb15 \ comb32 \ comb40 \ comb60 \ comb65 ///
\ comb75 \ comb82 \ comb85 \ comb99 \ comb108 \ comb110 \ comb140 ///
\ comb159 \ comb175 \ comb191 \ comb201 \ comb204 \ comb210 \ comb223


* Holocaust denial
recode country (82=.)

levelsof country, local(lev)	
	
foreach i of local lev {
sem (<- ideo holocaust if country == `i'), standardize
matrix mat`i' = r(table)
scalar corr`i' = mat`i'[1, 5]
scalar lower`i' = mat`i'[5, 5]
scalar upper`i' = mat`i'[6, 5]
matrix comb`i' = corr`i' , lower`i' , upper`i'
matrix rownames comb`i' = "Holocaust"
}

matrix holocaust = comb1 \ comb15 \ comb32 \ comb40 \ comb60 \ comb65 ///
\ comb75 \ comb82 \ comb85 \ comb99 \ comb108 \ comb110 \ comb140 ///
\ comb159 \ comb175 \ comb191 \ comb201 \ comb204 \ comb210 \ comb223


* Combine and save correlations
matrix RESULTS = truther \ antivaxx \ singlegroup \ globalwarming \ ///
aliens \ aids \ holocaust \ moon \ covidmyth \ exaggerated \ pharma

preserve
matsave RESULTS, dropall
export delimited using "Cross-national Correlations.csv", replace
erase RESULTS.dta
clear
restore	

********************************************************************************

****
** Table A2
**** 

bysort country: tab gender_all
bysort country: tab age
bysort country: tab education

